package demo2.demo2.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LoginController {

    @RequestMapping("/hello")
    @ResponseBody
    public String hello (){

        return "hello world";
    }

    @RequestMapping("/login.html")
   // @ResponseBody
    public String login(){
        return "login.html";
    }


    // Login form with error
    @RequestMapping("/login-error.html")
    public String loginError(Model model) {
        model.addAttribute("loginError", true);
        return "login.html";
    }



    @RequestMapping("/index")
    public String index() {
        return "index.html";
    }


}
